﻿
using UnityEngine;
using UnityEngine.UI;
using ZYLFramework.UI;

namespace Game.UI
{
    public class StatePanel
    {
        public GameObject Go;
        public Image BGImage;
        public Text HpText;

        public StatePanel(string path,GameObject panel)
        {
            Go = UICommoncs.UIAddChild(path,panel);
            BGImage = Go.transform.Find("").GetComponent<Image>();
            HpText = Go.transform.Find("HpText").GetComponent<Text>();
        }
    }
    
    public class PawnStatePanelView:UIView
    {
        public RectTransform PawnStatePanel;
        public string Path = "Prefabs/UI/";
        public Image DebugInfo;
        public Text Text;

        public override void Init()
        {
            var go = Panel.gameObject;
			PawnStatePanel = go.transform.Find("").GetComponent<RectTransform>();
            DebugInfo = go.transform.Find("DebugInfo").GetComponent<Image>();
            Text = go.transform.Find("DebugInfo/Text").GetComponent<Text>();
        }
        
        public StatePanel NewStatePanel()
        {
            return new StatePanel(Path+"StatePanel",PawnStatePanel.gameObject);
        }
    }
}
